package com.wisedu.w5autocode.dialog;

import java.util.List;

import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.swt.widgets.Shell;

@SuppressWarnings("restriction")
public class ProjectClassSelectionDialog extends OpenTypeSelectionDialog{

	public ProjectClassSelectionDialog(Shell parent, IRunnableContext context, IJavaProject p) {
		super(parent, true, context, createSearchScope(p), IJavaSearchConstants.CLASS_AND_ENUM);
	}

	private static IJavaSearchScope createSearchScope(IJavaProject p) {
		return SearchEngine.createJavaSearchScope(new IJavaProject[] { p });
	}
	
	@Override
	protected void setResult(List newResult) {
		super.setResult(newResult);
	}
	
}
